#include <iostream>
using namespace std;
class Date
{
public:
	Date(int y=1990,int m=1,int d=1):year(y),month(m),day(d)
	{
		cout<<"Date Constructor"<<endl;
	}
	
	void print() const
	{
		cout<<year<<"-"<<month<<"-"<<day;
	}
private:
	int year,month,day;
};

class Person
{
public:
	//Person(string n="NoName",int y=1990,int m=1,int d=1):name(n),year(y),month(m),day(d)
	Person(string n="NoName",int y=1990,int m=1,int d=1):name(n),birth(y,m,d)
	{
		cout<<"Person Constructor1"<<endl;
	}
	Person(string n,Date d):name(n),birth(d)
	{
		cout<<"Person Constructor2"<<endl;
	}
	void print() const
	{
		cout<<name<<"'s birthday is  ";
		birth.print();
		//cout<<birth.year<<"-"<<birth.month<<"-"<<birth.day;
		cout<<endl;
	}
private:
	string name;
	Date birth;
};

int main()
{
	Person tom("Tom",2003,5,2);
	tom.print();
	
	Date d(2023,2,28);
	Person mike("Mike",d);
	mike.print();
	
	return 0;
}